package com.example.administrator.myapplication.Presenter;

import com.example.administrator.myapplication.Bean.Notice;
import com.example.administrator.myapplication.Model.INoticeModel;
import com.example.administrator.myapplication.Model.NoticeModel;
import com.example.administrator.myapplication.View.Fragment.INoticeView;

import java.util.List;

/**
 * Created by Administrator on 2019/10/18 0018.
 */

public class NoticePresenter implements INoticePresenter,INoticeListener {
    private INoticeModel iNoticeModel;
    private INoticeView iNoticeView;

    public NoticePresenter (INoticeView  iNoticeView) {
        this.iNoticeModel = new NoticeModel();
        this.iNoticeView = iNoticeView;
    }

    @Override
    public void getNotices(Notice notice) {
        iNoticeModel.getNotices(notice,this);
    }

    @Override
    public  void noticeList(List<Notice> notices) {
        iNoticeView.showNotices(notices);
    }

    @Override
    public void error(String msg) {
        iNoticeView.showError(msg);
    }
}
